package com.mrd.gtimpframe.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.mrd.gtimp.business.entity.Attachment;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

public class GenProtocolUnite implements Serializable {
    /**
     * 草稿
     */
    public static String CRAFT = "0";
    /**
     * 生效
     */
    public static String EFFECTIVE = "1";
    /**
     * 待确认
     */
    public static String WAIT_CONFIRM = "2";
    /**
     * 待生效
     */
    public static String WAIT_EFFECTIVE = "3";
    /**
     * 结束
     */
    public static String INVALID = "4";


    private String id;


    private String supplierId;
    private String supplierName;

    private String name;

    @JSONField(format = "yyyy-MM-dd")
    private Date eftimeStart;

    @JSONField(format = "yyyy-MM-dd")
    private Date eftimeEnd;

    private String status;

    private String creator;

    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date ctime;

    private String modifier;

    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date mtime;

    private String remark;

    private Attachment file;

    List<GenProtocol> protocolList;

    private static final long serialVersionUID = 1L;

    public GenProtocolUnite(String id, String supplierId, String name, Date eftimeStart, Date eftimeEnd, String status, String creator, Date ctime, String modifier, Date mtime, String remark) {
        this.id = id;
        this.supplierId = supplierId;
        this.name = name;
        this.eftimeStart = eftimeStart;
        this.eftimeEnd = eftimeEnd;
        this.status = status;
        this.creator = creator;
        this.ctime = ctime;
        this.modifier = modifier;
        this.mtime = mtime;
        this.remark = remark;
    }

    public GenProtocolUnite(String id, String supplierId, String supplierName, String name, Date eftimeStart, Date eftimeEnd, String status, String creator, Date ctime, String modifier, Date mtime, String remark) {
        this.id = id;
        this.supplierName = supplierName;
        this.supplierId = supplierId;
        this.name = name;
        this.eftimeStart = eftimeStart;
        this.eftimeEnd = eftimeEnd;
        this.status = status;
        this.creator = creator;
        this.ctime = ctime;
        this.modifier = modifier;
        this.mtime = mtime;
        this.remark = remark;
    }

    public GenProtocolUnite() {
        super();
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id == null ? null : id.trim();
    }

    public String getSupplierId() {
        return supplierId;
    }

    public void setSupplierId(String supplierId) {
        this.supplierId = supplierId == null ? null : supplierId.trim();
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name == null ? null : name.trim();
    }

    public Date getEftimeStart() {
        return eftimeStart;
    }

    public void setEftimeStart(Date eftimeStart) {
        this.eftimeStart = eftimeStart;
    }

    public Date getEftimeEnd() {
        return eftimeEnd;
    }

    public void setEftimeEnd(Date eftimeEnd) {
        this.eftimeEnd = eftimeEnd;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status == null ? null : status.trim();
    }

    public String getCreator() {
        return creator;
    }

    public void setCreator(String creator) {
        this.creator = creator == null ? null : creator.trim();
    }

    public Date getCtime() {
        return ctime;
    }

    public void setCtime(Date ctime) {
        this.ctime = ctime;
    }

    public String getModifier() {
        return modifier;
    }

    public void setModifier(String modifier) {
        this.modifier = modifier == null ? null : modifier.trim();
    }

    public Date getMtime() {
        return mtime;
    }

    public void setMtime(Date mtime) {
        this.mtime = mtime;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark == null ? null : remark.trim();
    }

    public String getSupplierName() {
        return supplierName;
    }

    public void setSupplierName(String supplierName) {
        this.supplierName = supplierName;
    }

    public Attachment getFile() {
        return file;
    }

    public void setFile(Attachment file) {
        this.file = file;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", supplierId=").append(supplierId);
        sb.append(", name=").append(name);
        sb.append(", eftimeStart=").append(eftimeStart);
        sb.append(", eftimeEnd=").append(eftimeEnd);
        sb.append(", status=").append(status);
        sb.append(", creator=").append(creator);
        sb.append(", ctime=").append(ctime);
        sb.append(", modifier=").append(modifier);
        sb.append(", mtime=").append(mtime);
        sb.append(", remark=").append(remark);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        GenProtocolUnite other = (GenProtocolUnite) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getSupplierId() == null ? other.getSupplierId() == null : this.getSupplierId().equals(other.getSupplierId()))
            && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
            && (this.getEftimeStart() == null ? other.getEftimeStart() == null : this.getEftimeStart().equals(other.getEftimeStart()))
            && (this.getEftimeEnd() == null ? other.getEftimeEnd() == null : this.getEftimeEnd().equals(other.getEftimeEnd()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getCreator() == null ? other.getCreator() == null : this.getCreator().equals(other.getCreator()))
            && (this.getCtime() == null ? other.getCtime() == null : this.getCtime().equals(other.getCtime()))
            && (this.getModifier() == null ? other.getModifier() == null : this.getModifier().equals(other.getModifier()))
            && (this.getMtime() == null ? other.getMtime() == null : this.getMtime().equals(other.getMtime()))
            && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getSupplierId() == null) ? 0 : getSupplierId().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getEftimeStart() == null) ? 0 : getEftimeStart().hashCode());
        result = prime * result + ((getEftimeEnd() == null) ? 0 : getEftimeEnd().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getCreator() == null) ? 0 : getCreator().hashCode());
        result = prime * result + ((getCtime() == null) ? 0 : getCtime().hashCode());
        result = prime * result + ((getModifier() == null) ? 0 : getModifier().hashCode());
        result = prime * result + ((getMtime() == null) ? 0 : getMtime().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        return result;
    }
}
